"""meiduo_mall URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.http import HttpResponse


def log(request):
    """
    1.日志是为了方便我们上下后分析问题
    2.日志的配置 我们直接复制到setting中就可以
    3.日志的级别 Debug, warning, error, critical
    4.使用import logging
    # 创建日志记录器
    logger = logging.getLogger('django')
     # 输出日志
    logger.debug('测试logging模块debug')
    logger.info('测试logging模块info')
    logger.error('测试logging模块error')

    """
    import logging

    logger = logging.getLogger('django')
    logger.info('info~~~')
    logger.warning('warning')
    return HttpResponse('log')


from django.contrib import admin
from django.urls import path, re_path, include

urlpatterns = [
    re_path(r'^', include('apps.users.urls', namespace='users')),
    re_path(r'^', include('apps.contents.urls', namespace='contents')),
    re_path(r'^', include('apps.verifications.urls', namespace='verifications')),
    re_path(r'^admin/', admin.site.urls),
    # re_path(r'^log/', log),
]
